Page({

  data: {
  },

  onLoad: function (options) {
    console.log("optionId:" + options.id);
    this.setData({
      mid: options.id
    })

    var that =this;//设置全局变量

    wx.request({
      url: 'https://api.xhboke.com/movie/info?id='+options.id,
      method: 'GET',
      // data: {
      //   id: 'x'
      // },
      header: {
        "Content-Type":"application/json"
      },
      success: function (res) {
        console.log(res)
        if(res.statusCode==200){
          that.setData({
            movie: res.data
          })

          wx.setNavigationBarTitle({
            title: 'title',
          })
          //loading
          wx.hideNavigationBarLoading({
            success: (res) => {},
          })
        }
      },
      fail: function () {

      },
      complete: function () {

      }

    })
  }
})